package com.springcloud.rabbitmqdemo.service;

import java.util.Date;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class Sender {

	@Autowired
	private AmqpTemplate rabbitTemplate;
	
	public void send(int id){
		String content = "hello"+new Date()+"the id is  :" +id;
		System.out.println("Sender :"+content);
		this.rabbitTemplate.convertAndSend("hello", content);
	}
	
}
